import request from '@/utils/request'

const api_name = '/std/major'
export default {
  save(major) {
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: major
    })
  },
  getById(id) {
    return request({
      url: `${api_name}/${id}`,
      method: 'get'
    })
  },
  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },

  getList(deptId) {
    return request({
      url: `${api_name}/list`,
      method: 'get',
      params: { deptId: deptId }
    })
  },

  removeById(id) {
    var param = [id]
    return request({
      url: `${api_name}/removes`,
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data: JSON.stringify(param)
    })
  }
}
